package com.estate.report.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;


/**
 * 数据统计类型
 *
 * @author jpp
 * @since 2025/10/27
 */
@Getter
@AllArgsConstructor
public enum StatisticsSearchTypeEnum {
    SALE_GMV("sale_gmv", "sale_price", "全部销售GMV统计"),
    SALE_NUM("sale_num", "sale_num", "成交数量统计"),
    SALE_NEW_LEADS("sale_new_leads", "sale_new_leads", "新的销售线索"),
    SALES_MID_PRICE("sale_mid_price", "", "售价中位数"),
    SALE_RANK("sale_rank", "sale_price", "Sales组表现排行"),
    SALE_GMV_TREND("sale_gmv_trend", "sale_price", "销售GMV趋势"),
    SALE_TYPE_RATE("sale_type_rate", "sale_type_num", "已售房产类型占比"),
    SALE_PRICE_RANGE_RATE("sale_price_range_rate", "sale_price_range", "已售房产价格区间占比"),
    SALE_SUBURB_RATE("sale_suburb_rate", "sale_suburb_num", "已售房产区域占比"),
    LEASE_GMV("lease_gmv", "lease_price", "全部租赁GMV统计"),
    LEASE_NUM("lease_num", "lease_num", "成交数量统计"),
    LEASE_NEW_LEADS("lease_new_leads", "lease_new_leads", "新的租赁线索"),
    LEASE_MID_PRICE("lease_mid_price", "", "租价中位数"),
    LEASE_RANK("lease_rank", "lease_price", "Lease组表现排行"),
    LEASE_GMV_TREND("lease_gmv_trend", "lease_price", "租赁GMV趋势"),
    LEASE_TYPE_RATE("lease_type_rate", "lease_type_num", "已租房产类型占比"),
    LEASE_PRICE_RANGE_RATE("lease_price_range_rate", "lease_price_range", "已租房产价格区间占比"),
    LEASE_SUBURB_RATE("lease_suburb_rate", "lease_suburb_num", "已租房产区域占比"),
    ;

    private final String type;

    private final String statisticsType;

    private final String desc;

    public static StatisticsSearchTypeEnum getByType(String type) {
        for (StatisticsSearchTypeEnum value : StatisticsSearchTypeEnum.values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

}
